<script setup lang="ts">
import { computed } from 'vue'

interface Props {
  prefix?: string
  name?: string
}

const props = withDefaults(defineProps<Props>(), { prefix: 'icon' })

const symbolId = computed<string>(() => {
  return `#${props.prefix}-${props.name}`
})
</script>

<template>
  <svg aria-hidden="true" class="cp-icon">
    <!-- #icon-文件夹名称-图片名称 -->
    <use :href="symbolId" />
  </svg>
</template>

<style lang="scss" scoped>
.cp-icon {
  width: 1em;
  height: 1em;
}
</style>
